{% set product = hookable_metadata.context.resource %}

<div class="card mb-3">
    <div class="card-header">
        <div class="card-title">
            {{ 'sylius.ui.translations'|trans }}
        </div>
    </div>
    <div class="accordion accordion-flush" id="product-translations">
        {% for product_translation in product.translations %}
            {% set locale = product_translation.locale %}

            <div class="accordion-item">
                <h2 class="accordion-header">
                    <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#translation-{{ locale }}" aria-expanded="{% if loop.first %}true{% else %}false{% endif %}" aria-controls="translation-{{ locale }}">
                        {{ locale|sylius_locale_name }}

                        <span class="accordion-button-toggle">
                            {{ ux_icon('tabler:chevron-down') }}
                        </span>
                    </button>
                </h2>
                <div id="translation-{{ locale }}" class="accordion-collapse collapse" data-bs-parent="#product-translations">
                    <div class="accordion-body bg-gray-100">
                        <div class="card mb-3 mx-md-5">
                            <div class="card-header">
                                <div class="card-title">{{ 'sylius.ui.content'|trans }}</div>
                            </div>
                            <div class="card-body">
                                <div class="divide-y">
                                    {% hook 'translations' with { product_translation } %}
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        {% endfor %}
    </div>
</div>
